```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>掌握Java枚举 提升代码质量</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            color: #222;
        }
        .hero {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .code-block {
            background-color: #282c34;
            border-radius: 8px;
            position: relative;
        }
        .code-block pre {
            margin: 0;
            padding: 1.5rem;
            overflow-x: auto;
        }
        .code-block .lang {
            position: absolute;
            top: 0;
            right: 0;
            padding: 0.25rem 0.75rem;
            background-color: rgba(255,255,255,0.1);
            color: #abb2bf;
            font-size: 0.8rem;
            border-bottom-left-radius: 4px;
            border-top-right-radius: 7px;
        }
        .enum-card {
            transition: all 0.3s ease;
            border-left: 4px solid #667eea;
        }
        .enum-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }
        .feature-icon {
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-size: 1.5rem;
            margin-right: 1rem;
        }
        .interview-card {
            border-left: 4px solid #4fd1c5;
        }
        .mermaid {
            background-color: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero text-white py-20 px-4 md:py-32">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4 leading-tight">掌握Java枚举<br>提升代码质量</h1>
                    <p class="text-xl mb-8 opacity-90">从if-else地狱到优雅设计模式的华丽转变</p>
                    <div class="flex items-center">
                        <div class="mr-4">
                            <i class="fas fa-code-branch text-2xl"></i>
                            <span class="block text-sm">减少90%代码</span>
                        </div>
                        <div class="mr-4">
                            <i class="fas fa-layer-group text-2xl"></i>
                            <span class="block text-sm">5种高级用法</span>
                        </div>
                        <div>
                            <i class="fas fa-chart-line text-2xl"></i>
                            <span class="block text-sm">性能提升40%</span>
                        </div>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-filter backdrop-blur-sm">
                        <div class="flex items-start mb-4">
                            <div class="bg-yellow-400 text-gray-800 p-2 rounded-full mr-3">
                                <i class="fas fa-exclamation-circle"></i>
                            </div>
                            <div>
                                <h3 class="font-bold">代码评审争议</h3>
                                <p class="text-sm opacity-80">"枚举是过度设计还是提升代码质量的神器？"</p>
                            </div>
                        </div>
                        <div class="code-block mb-4">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>if (color == Color.RED) {
    // 处理红色逻辑
} else if (color == Color.GREEN) {
    // 处理绿色逻辑
} else if (color == Color.BLUE) {
    // 处理蓝色逻辑
}</code></pre>
                        </div>
                        <div class="flex justify-center">
                            <i class="fas fa-arrow-down text-xl opacity-70"></i>
                        </div>
                        <div class="code-block mt-2">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public double calculateFee(double amount) {
    return feeCalculator.apply(amount);
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction -->
    <section class="py-16 px-4 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">枚举：Java中被严重低估的特性</h2>
                <p class="max-w-2xl mx-auto text-gray-600">"真正理解枚举的程序员，写出来的代码就是不一样。" — 资深架构师评语</p>
            </div>
            
            <div class="grid md:grid-cols-3 gap-8">
                <div class="enum-card bg-white p-6 rounded-lg shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="feature-icon">
                            <i class="fas fa-cubes"></i>
                        </div>
                        <h3 class="text-xl font-bold">不仅仅是常量</h3>
                    </div>
                    <p class="text-gray-600">枚举本质上是特殊的类，可以包含字段、方法、实现接口，具有完整面向对象特性。</p>
                </div>
                
                <div class="enum-card bg-white p-6 rounded-lg shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="feature-icon">
                            <i class="fas fa-project-diagram"></i>
                        </div>
                        <h3 class="text-xl font-bold">设计模式利器</h3>
                    </div>
                    <p class="text-gray-600">完美实现策略模式、状态模式、工厂模式等，代码量减少90%的同时提高可维护性。</p>
                </div>
                
                <div class="enum-card bg-white p-6 rounded-lg shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="feature-icon">
                            <i class="fas fa-tachometer-alt"></i>
                        </div>
                        <h3 class="text-xl font-bold">性能优化</h3>
                    </div>
                    <p class="text-gray-600">EnumSet/EnumMap针对枚举优化，比HashSet/HashMap性能提升40%，内存占用更少。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Content Section -->
    <section class="py-16 px-4 bg-gray-50">
        <div class="container mx-auto max-w-6xl">
            <!-- 基本概念 -->
            <div class="mb-20">
                <h2 class="text-3xl font-bold mb-8 border-b pb-2">一、枚举的基本概念与常见误区</h2>
                
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800">1. 枚举不仅仅是常量的容器</h3>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <p class="mb-4 text-gray-700">初级开发者通常只把枚举当作常量集合使用，忽视了它作为完整类的强大能力。</p>
                            <div class="code-block mb-4">
                                <div class="lang">Java</div>
                                <pre class="text-gray-300"><code>public enum Color {
    RED, GREEN, BLUE
}</code></pre>
                            </div>
                            <p class="text-sm text-gray-500">这种用法只发挥了枚举1%的能力</p>
                        </div>
                        <div>
                            <p class="mb-4 text-gray-700">枚举实际上是一个继承自java.lang.Enum的特殊类，可以拥有完整的方法和字段。</p>
                            <div class="code-block">
                                <div class="lang">Java (反编译)</div>
                                <pre class="text-gray-300"><code>public final class Color extends Enum&lt;Color&gt; {
    public static final Color RED = new Color();
    public static final Color GREEN = new Color();
    public static final Color BLUE = new Color();
    // ...
}</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800">2. 对比：常量使用 vs 完整对象</h3>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <div class="bg-red-50 p-4 rounded-lg border border-red-200">
                                <h4 class="font-bold text-red-700 mb-3 flex items-center">
                                    <i class="fas fa-times-circle mr-2"></i>
                                    不好示例
                                </h4>
                            <div class="code-block">
                                <div class="lang">Java</div>
                                <pre class="text-gray-300"><code>public enum PaymentType {
    CREDIT_CARD, DEBIT_CARD, PAYPAL
}

public double calculateFee(PaymentType type, double amount) {
    if (type == PaymentType.CREDIT_CARD) {
        return amount * 0.03;
    } else if (type == PaymentType.DEBIT_CARD) {
        return amount * 0.01;
    }
    // ...
}</code></pre>
                            </div>
                            </div>
                        </div>
                        <div>
                            <div class="bg-green-50 p-4 rounded-lg border border-green-200">
                                <h4 class="font-bold text-green-700 mb-3 flex items-center">
                                    <i class="fas fa-check-circle mr-2"></i>
                                    优秀示例
                                </h4>
                            <div class="code-block">
                                <div class="lang">Java</div>
                                <pre class="text-gray-300"><code>public enum PaymentType {
    CREDIT_CARD(amount -> amount * 0.03),
    DEBIT_CARD(amount -> amount * 0.01),
    PAYPAL(amount -> amount * 0.02 + 0.3);
    
    private final Function&lt;Double, Double&gt; feeCalculator;
    
    PaymentType(Function&lt;Double, Double&gt; feeCalculator) {
        this.feeCalculator = feeCalculator;
    }
    
    public double calculateFee(double amount) {
        return feeCalculator.apply(amount);
    }
}</code></pre>
                            </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 进阶用法 -->
            <div class="mb-20">
                <h2 class="text-3xl font-bold mb-8 border-b pb-2">二、枚举进阶用法</h2>
                
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800">1. 存储更多信息</h3>
                    <p class="mb-6 text-gray-700">枚举可以像普通类一样拥有字段、构造函数和方法，为每个枚举常量存储额外信息。</p>
                    <div class="code-block">
                        <div class="lang">Java</div>
                        <pre class="text-gray-300"><code>public enum Planet {
    MERCURY(3.303e+23, 2.4397e6),
    VENUS(4.869e+24, 6.0518e6),
    EARTH(5.976e+24, 6.37814e6);
    
    private final double mass;   // 质量（千克）
    private final double radius; // 半径（米）
    
    Planet(double mass, double radius) {
        this.mass = mass;
        this.radius = radius;
    }
    
    // 计算表面重力
    public double surfaceGravity() {
        return G * mass / (radius * radius);
    }
    
    private static final double G = 6.67300E-11;
}</code></pre>
                    </div>
                </div>
                
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800">2. 策略模式的绝佳选择</h3>
                    <p class="mb-6 text-gray-700">枚举非常适合实现策略模式，尤其是当策略数量固定时。</p>
                    <div class="code-block mb-6">
                        <div class="lang">Java</div>
                        <pre class="text-gray-300"><code>public enum DiscountStrategy {
    NONE(price -> price),
    NEW_CUSTOMER(price -> price * 0.9),
    VIP(price -> price * 0.7),
    SUPER_VIP(price -> price * 0.5);
    
    private final Function&lt;Double, Double&gt; discountFunction;
    
    DiscountStrategy(Function&lt;Double, Double&gt; discountFunction) {
        this.discountFunction = discountFunction;
    }
    
    public double applyDiscount(double price) {
        return discountFunction.apply(price);
    }
}</code></pre>
                    </div>
                    <div class="bg-blue-50 p-4 rounded-lg border border-blue-200">
                        <h4 class="font-bold text-blue-700 mb-2 flex items-center">
                            <i class="fas fa-lightbulb mr-2"></i>
                            使用示例
                        </h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>double discountedPrice = DiscountStrategy.VIP.applyDiscount(100.0);  // 70.0</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800">3. EnumSet和EnumMap性能优化</h3>
                    <p class="mb-6 text-gray-700">Java提供了专门为枚举优化的集合类，比普通集合性能更好，内存占用更少。</p>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <div class="code-block">
                                <div class="lang">Java</div>
                                <pre class="text-gray-300"><code>// EnumSet示例
EnumSet&lt;Permission&gt; permissions = 
    EnumSet.of(Permission.READ, Permission.WRITE);

if (permissions.contains(Permission.DELETE)) {
    // 检查权限
}</code></pre>
                            </div>
                        </div>
                        <div>
                            <div class="code-block">
                                <div class="lang">Java</div>
                                <pre class="text-gray-300"><code>// EnumMap示例
EnumMap&lt;Permission, String&gt; descriptions = 
    new EnumMap&lt;&gt;(Permission.class);

descriptions.put(Permission.READ, "允许读取");
descriptions.put(Permission.WRITE, "允许写入");</code></pre>
                            </div>
                        </div>
                    </div>
                    <div class="mt-4 bg-yellow-50 p-4 rounded-lg border border-yellow-200">
                        <h4 class="font-bold text-yellow-700 mb-2 flex items-center">
                            <i class="fas fa-bolt mr-2"></i>
                            性能优势
                        </h4>
                        <ul class="list-disc pl-5 text-gray-700">
                            <li>EnumSet使用位向量实现，操作时间复杂度O(1)</li>
                            <li>EnumMap使用数组实现，比HashMap快40%</li>
                            <li>内存占用更少，没有哈希冲突问题</li>
                        </ul>
                    </div>
                </div>
            </div>
            
            <!-- 消灭复杂条件分支 -->
            <div class="mb-20">
                <h2 class="text-3xl font-bold mb-8 border-b pb-2">三、消灭复杂条件分支</h2>
                
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800">1. 从200行if-else到20行枚举</h3>
                    <p class="mb-6 text-gray-700">订单状态管理系统的重构案例：使用枚举封装状态转换逻辑。</p>
                    
                    <div class="bg-red-50 p-4 rounded-lg border border-red-200 mb-6">
                        <h4 class="font-bold text-red-700 mb-3 flex items-center">
                            <i class="fas fa-times-circle mr-2"></i>
                            重构前：if-else地狱
                        </h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public boolean canTransitionTo(OrderStatus current, OrderStatus newStatus) {
    if (current == OrderStatus.CREATED) {
        if (newStatus == OrderStatus.PAID || newStatus == OrderStatus.CANCELLED) {
            return true;
        }
    } else if (current == OrderStatus.PAID) {
        if (newStatus == OrderStatus.PROCESSING || newStatus == OrderStatus.REFUNDED) {
            return true;
        }
    } 
    // 还有更多条件...
    return false;
}</code></pre>
                        </div>
                    </div>
                    
                    <div class="bg-green-50 p-4 rounded-lg border border-green-200">
                        <h4 class="font-bold text-green-700 mb-3 flex items-center">
                            <i class="fas fa-check-circle mr-2"></i>
                            重构后：枚举状态机
                        </h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public enum OrderStatus {
    CREATED(EnumSet.of(PAID, CANCELLED)),
    PAID(EnumSet.of(PROCESSING, REFUNDED)),
    PROCESSING(EnumSet.of(SHIPPED, CANCELLED)),
    // 其他状态...
    
    private final EnumSet&lt;OrderStatus&gt; allowedNextStatus;
    
    OrderStatus(EnumSet&lt;OrderStatus&gt; allowedNextStatus) {
        this.allowedNextStatus = allowedNextStatus;
    }
    
    public boolean canTransitionTo(OrderStatus newStatus) {
        return allowedNextStatus.contains(newStatus);
    }
}</code></pre>
                        </div>
                    </div>
                    
                    <div class="mt-6 grid md:grid-cols-3 gap-4 text-center">
                        <div class="bg-white p-4 rounded-lg shadow-sm">
                            <div class="text-3xl font-bold text-blue-600 mb-2">90%</div>
                            <div class="text-gray-600">代码量减少</div>
                        </div>
                        <div class="bg-white p-4 rounded-lg shadow-sm">
                            <div class="text-3xl font-bold text-blue-600 mb-2">100%</div>
                            <div class="text-gray-600">可维护性提升</div>
                        </div>
                        <div class="bg-white p-4 rounded-lg shadow-sm">
                            <div class="text-3xl font-bold text-blue-600 mb-2">40%</div>
                            <div class="text-gray-600">性能提升</div>
                        </div>
                    </div>
                </div>
                
                <div class="mb-12">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800">2. 支付系统重构案例</h3>
                    <p class="mb-6 text-gray-700">将复杂的支付处理逻辑封装到枚举中，每种支付方式独立实现自己的处理逻辑。</p>
                    
                    <div class="mermaid mb-8">
                        graph TD
                            A[支付请求] --> B{支付方式}
                            B -->|信用卡| C[信用卡处理]
                            B -->|支付宝| D[支付宝处理]
                            B -->|微信支付| E[微信支付处理]
                            C --> F[返回结果]
                            D --> F
                            E --> F
                    </div>
                    
                    <div class="code-block">
                        <div class="lang">Java</div>
                        <pre class="text-gray-300"><code>public enum PaymentMethod {
    CREDIT_CARD {
        @Override
        public PaymentResult process(double amount, PaymentContext context) {
            // 信用卡特定逻辑
            if (!validateCreditCard(context)) {
                return PaymentResult.error("信用卡无效");
            }
            double fee = calculateFee(amount);
            String txId = creditCardGateway.charge(amount + fee, context);
            return PaymentResult.success(txId, fee);
        }
    },
    
    ALIPAY {
        @Override
        public PaymentResult process(double amount, PaymentContext context) {
            // 支付宝特定逻辑
            double fee = calculateFee(amount);
            String url = alipayService.generateUrl(amount + fee, context);
            return PaymentResult.pending(url, fee);
        }
    };
    
    public abstract PaymentResult process(double amount, PaymentContext context);
    
    protected boolean validateCreditCard(PaymentContext context) {
        // 共享的验证逻辑
    }
}</code></pre>
                    </div>
                </div>
            </div>
            
            <!-- 设计模式 -->
            <div class="mb-20">
                <h2 class="text-3xl font-bold mb-8 border-b pb-2">四、枚举与设计模式的完美结合</h2>
                
                <div class="grid md:grid-cols-2 gap-8 mb-12">
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-crown mr-2 text-purple-600"></i>
                            单例模式
                        </h3>
                        <p class="mb-4 text-gray-600">使用枚举实现单例是最佳实践，由JVM保证线程安全和单一实例。</p>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public enum Singleton {
    INSTANCE;
    
    private final Connection connection;
    
    Singleton() {
        connection = Database.connect();
    }
    
    public Connection getConnection() {
        return connection;
    }
}</code></pre>
                        </div>
                    </div>
                    
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-chess-knight mr-2 text-blue-600"></i>
                            策略模式
                        </h3>
                        <p class="mb-4 text-gray-600">枚举是固定策略集合的理想选择，比传统策略模式实现更简洁。</p>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public enum InventoryStrategy {
    PHYSICAL {
        public boolean hasStock(Product p, int qty) {
            return p.getStock() >= qty;
        }
    },
    DIGITAL {
        public boolean hasStock(Product p, int qty) {
            return true; // 数字产品总有库存
        }
    };
    
    public abstract boolean hasStock(Product p, int qty);
}</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-sitemap mr-2 text-green-600"></i>
                            状态模式
                        </h3>
                        <p class="mb-4 text-gray-600">枚举完美实现状态机，每个状态知道如何转换和执行进入/退出动作。</p>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public enum OrderState {
    PENDING {
        public OrderState next(OrderEvent e) {
            return e == PAYMENT_RECEIVED ? PROCESSING : this;
        }
        public void enter(Order o) {
            notifyCustomer(o);
        }
    },
    PROCESSING {
        // ...
    };
    
    public abstract OrderState next(OrderEvent e);
    public void enter(Order o) {}
}</code></pre>
                        </div>
                    </div>
                    
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-industry mr-2 text-orange-600"></i>
                            工厂模式
                        </h3>
                        <p class="mb-4 text-gray-600">当产品类型固定时，枚举是实现工厂模式的优雅方式。</p>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public enum NotificationFactory {
    EMAIL {
        public NotificationService create() {
            return new EmailService();
        }
    },
    SMS {
        public NotificationService create() {
            return new SmsService();
        }
    };
    
    public abstract NotificationService create();
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 面试问题 -->
            <div class="mb-12">
                <h2 class="text-3xl font-bold mb-8 border-b pb-2">五、面试中的枚举相关问题解析</h2>
                
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="interview-card bg-white p-6 rounded-lg shadow-md">
                        <h3 class="text-xl font-bold mb-3 text-gray-800">1. Java枚举与常量相比有什么优势？</h3>
                        <ul class="list-disc pl-5 text-gray-700">
                            <li><strong>类型安全：</strong>编译器会检查类型，避免不相关常量互相赋值</li>
                            <li><strong>功能丰富：</strong>可以有方法、字段和构造函数</li>
                            <li><strong>单例保证：</strong>每个枚举常量在JVM中只有一个实例</li>
                            <li><strong>序列化支持：</strong>内置序列化支持，无需额外代码</li>
                        </ul>
                    </div>
                    
                    <div class="interview-card bg-white p-6 rounded-lg shadow-md">
                        <h3 class="text-xl font-bold mb-3 text-gray-800">2. 如何实现枚举的单例模式？</h3>
                        <div class="code-block mb-3">
                            <div class="lang">Java</div>
                            <pre class="text-gray-300"><code>public enum Singleton {
    INSTANCE;
    // 添加方法和字段
}</code></pre>
                        </div>
                        <p class="text-gray-700"><strong>优势：</strong>线程安全、防反射攻击、自动序列化支持</p>
                    </div>
                </div>
                
                <div class="interview-card bg-white p-6 rounded-lg shadow-md mt-6">
                    <h3 class="text-xl font-bold mb-3 text-gray-800">3. EnumSet和EnumMap的内部实现及性能优势？</h3>
                    <div class="grid md:grid-cols-2 gap-4">
                        <div>
                            <h4 class="font-semibold mb-2 text-blue-600">EnumSet</h4>
                            <ul class="list-disc pl-5 text-gray-700">
                                <li>位向量实现（通常是long值）</li>
                                <li>操作时间复杂度O(1)</li>
                                <li>内存占用极小</li>
                            </ul>
                        </div>
                        <div>
                            <h4 class="font-semibold mb-2 text-blue-600">EnumMap</h4>
                            <ul class="list-disc pl-5 text-gray-700">
                                <li>数组实现（索引=ordinal）</li>
                                <li>比HashMap快40%</li>
                                <li>无哈希冲突</li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <div class="bg-blue-50 p-6 rounded-lg border border-blue-200 mt-8">
                    <h3 class="text-xl font-bold mb-4 text-blue-700 flex items-center">
                        <i class="fas fa-lightbulb mr-2"></i>
                        面试展示技巧
                    </h3>
                    <ul class="list-disc pl-5 text-gray-700">
                        <li><strong>准备重构案例：</strong>"在我的项目中，使用枚举将200行if-else减少到20行..."</li>
                        <li><strong>展示性能优化：</strong>"通过EnumSet替代HashSet，权限检查性能提升40%..."</li>
                        <li><strong>讲解设计模式：</strong>演示如何用枚举实现策略、状态等模式</li>
                        <li><strong>强调代码质量：</strong>突出可维护性、可读性、可扩展性提升</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                    <p class="text-gray-400">专业的编程技术分享平台</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-blue-400 hover:text-blue-300 transition-colors">
                        <i class="fas fa-external-link-alt mr-2"></i>
                        www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```